-
Notifications
You must be signed in to change notification settings - Fork 1k
Check TypeScript errors during build #1081
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Thanks for this! I'll do a full review soon, but just to address your third point: https://github.com/huggingface/transformers/blob/c8c8dffbe45ebef0a8dba4a51024e5e5e498596b/src/transformers/models/mgp_str/processing_mgp_str.py#L102 has a similar issue where |
|
I would consider this as an issue in the original Python transformers lib. At least its docstring is wrong. I don't know any context about On the JS lib side, it's okey for me to ignore it for now. Nobody except TypeScript complains so far. |
|
Apologies for the delay - will finish the review now 👍 |
xenova
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great PR! Thanks again 😇
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
npm run typegen(andnpm run build) now will check TypeScript errors.I migrated
jsconfig.jsontotsconfig.jsonbecausetsc --buildcan only recognizetsconfig.json.tsc --buildis faster thantscbecausetsc --buildhas cache, so it's better to usetsc --build.Since it reveals all typing errors now, I need to address all of them to make the build pass.
Most of them are just missing types in configs, like the one below:
For those errors, I simply add
@ts-expect-errorcomment to let TypeScript ignore it. I use@ts-expect-errorinstead of@ts-ignorebecause we can remove those comments once we add missing types in the future.I fixed some other types issues that I can fix.
One thing I noticed is that MgpstrProcessor.batch_decode has different shape compared to the method in the parent class. This might not be a good idea.